package com.sky.mapper;

import com.sky.entity.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {

    List<Setmeal> getByCategoryId(Setmeal setmeal);

    @Select("select sd.name, sd.copies, d.description, d.image from setmeal_dish sd left join dish d on sd.dish_id = d.id where sd.setmeal_id = #{setmealId}")
    List<Setmeal> getById(Long setmealId);

    @Select("select * from setmeal where id = #{id}")
    Setmeal getSetmealById(@Param("id")Long setmealId);
}
